package com.only4play.practice.report.core.model.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.only4play.codegen.support.constants.BaseEnum;

import java.util.Optional;

/**
 * @author mdy
 * * @date 2024/10/21
 */
public enum ReportPlatformType  implements BaseEnum<ReportPlatformType> {

    // 智慧深圳平台
    SMART_SZ(5, "智慧深圳平台"),
    MEI_LI_SZ(7, "美丽深圳平台"),
    STOP_AND_PAY(10,"通停通付平台")
    ;

    ReportPlatformType(Integer code, String name) {
        this.code = code;
        this.name = name;
    }
    @EnumValue
    private Integer code;
    //  @JsonValue
    private String name;

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getName() {
        return this.name;
    }

    public static Optional<ReportPlatformType> of(Integer code) {
        return Optional.ofNullable(BaseEnum.parseByCode(ReportPlatformType.class, code));
    }

}
